Hitherto, tests have been executed to check whether a system under test in combination with other systems behaves properly in accordance with specifications. Such tests are needed for debugging the system under test and to verify compatibility between systems. Currently, many application programs (hereinafter referred to as “applications”) are expected to operate in combination with various systems, so that a test (integration test) must be executed on all the systems that can be combined.
In order to execute an integration test between a system under test and various systems that can be combined therewith, specific dependency settings must be prepared individually for systems under test or systems combined therewith, and test cases must be described individually for systems configured. These tasks require a lot of work, so that an improvement in the efficiency of test execution is desired.
In such an integration test, when an application is executed by a system, in some cases, the logic of the application is executed using resources provided by the system. For example, an application connects to a database, executes personal authentication, and so forth using a database connection class, an authentication mechanism, and so forth provided by the system. When a system such as a database is used, an integration test between the application and the system that executes the application is indispensable. As described above, many applications that use system resources must be written in consideration of the types of resources provided by systems.
For example, a class for connecting to a specific type of database is specified directly in source code or in an application-specific configuration file. In order to ensure that such an application can be executed by various systems, it is needed to rewrite application source code or to make application-specific setting on a system-by-system basis.
In accordance with the increasing interest in the combination of an application and systems used by the application, the concept of dependency injection (DI) has recently been proposed. In system based on DI (DI system), setting in a form called dependency is assigned from outside to combine resources used by the application (the application is also combined using dependency). Dependency refers to a description of resources (destinations) needed by a resource (source). For example, when a resource A requires a resource B, a dependency that “A is dependent on B” is written (A→B). Upon interpreting the dependency, the DI system constructs the resource B, and provides the resource B to the resource A by inserting code, by using a setter method, by specification from a constructor, or the like.
The article entitled “Memory Dump, Dependency Injection for Unit Tests,” (searched on Nov. 28, 2005) (http://jroller.com/page/ara_e/20040717#dependency_injection_for_unit_tests) discloses a specific example of using DI in a test system. In the testing method disclosed, unit tests are facilitated by minimizing external dependencies of components based on DI.
According to the above-referenced article, only a method of dependency injection for constructing a unit test system is disclosed, and a testing method or testing system for an integration test of a system in which a plurality of resources (execution environments) is injected is not disclosed.
As described above, through the spread of applications in the form of assets, an increased demand exists for designing and implementing recent applications so that the applications can be executed on various system configurations. For example, applications are implemented so that database connection classes of a plurality of vendors or various forms of authentication mechanisms can be used. In order to ensure by testing that the application can be executed on various system configurations that provide such resources, an integration test must be executed, in which joint tests for the application are executed on all the supported system configurations. However, the above-referenced article does not disclose a method for executing an integration test that covers a plurality of dependency-injected resources.
In order to overcome the problems described above, it is an object of the present invention to provide a method, device, and controlling program for executing an integration test of an application on a plurality of execution environments respectively that are dependency-injected.